unit TestModels;

interface
uses Matrix, ODEModel;

type TBruccelator = class(TODEModel)
public
  function F(t: extended; y:MatrixPtr): MatrixPtr; override;
  constructor Create(init:MatrixPtr; problemSize:integer);
end;

implementation
  constructor TBruccelator.Create(init:MatrixPtr; problemSize:integer);
  begin
    Inherited Create(init, problemSize);
  end;

  function TBruccelator.F(t: extended; y:MatrixPtr): MatrixPtr;
  var
  values : MatrixPtr;
  begin
    values := CreateMatrix(2, 1);

    SetMatrixElement(values, 1, 1, 2.0 + sqr(GetMatrixElement(y, 1, 1))*GetMatrixElement(y, 2, 1) - 9.533*GetMatrixElement(y, 1, 1));
    SetMatrixElement(values, 2, 1, 8.533 * GetMatrixElement(y, 1, 1) - sqr((GetMatrixElement(y, 1, 1)))*GetMatrixElement(y, 2, 1) );

    result := values;
  end;
end.
